/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:37:13  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.mh.entity;

import static javax.persistence.GenerationType.IDENTITY;
import java.util.Set;
import java.util.LinkedHashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.EntityListeners;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_mh_major_hazard_hch")
@SQLDelete(sql="update wwyt_mh_major_hazard_hch set delete_flag = '1' where id= ?")
@SQLDeleteAll(sql="update wwyt_mh_major_hazard_hch set delete_flag = '1' where id= ?")
@Where(clause="delete_flag = '0'")

public class MhMajorHazardHch implements java.io.Serializable{
    
    //columns START
    //
    private String id;
    //
    private String cas;
    //
    private String createBy;
    //
    private java.util.Date createTime;
    //
    private Double criticalValue;
    //
    private String deleteFlag;
    //
    private String hazardType;
    //
    private Double highValue1;
    //
    private Double highValue2;
    //
    private Double lowValue1;
    //
    private Double lowValue2;
    //
    private String majorHazardId;
    //
    private String name;
    //
    private Double realTimeValue;
    //
    private Double stock;
    //
    private String substanceStatus;
    //
    private String type;
    //
    private String unit;
    //
    private String updateBy;
    //
    private java.util.Date updateTime;
    //
    private Long hchId;
    //
    private Long sensorId;
    //租户ID
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //columns END


    public void setId(String value) {
        this.id = value;
    }
    
    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    @Column(name = "Id", unique = true, nullable = false)
    public String getId() {
        return this.id;
    }
    
     
    @Column(name = "cas", length = 10)
    public String getCas() {
        return this.cas;
    }
    
    public void setCas(String value) {
        this.cas = value;
    }
    
     
    @Column(name = "create_by", length = 32)
    public String getCreateBy() {
        return this.createBy;
    }
    
    public void setCreateBy(String value) {
        this.createBy = value;
    }
    
     
    @Column(name = "create_time")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }
    
     
    @Column(name = "critical_value")
    public Double getCriticalValue() {
        return this.criticalValue;
    }
    
    public void setCriticalValue(Double value) {
        this.criticalValue = value;
    }
    
     
    @Column(name = "delete_flag", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }
    
    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }
    
     
    @Column(name = "hazard_type", length = 32)
    public String getHazardType() {
        return this.hazardType;
    }
    
    public void setHazardType(String value) {
        this.hazardType = value;
    }
    
     
    @Column(name = "high_value1")
    public Double getHighValue1() {
        return this.highValue1;
    }
    
    public void setHighValue1(Double value) {
        this.highValue1 = value;
    }
    
     
    @Column(name = "high_value2")
    public Double getHighValue2() {
        return this.highValue2;
    }
    
    public void setHighValue2(Double value) {
        this.highValue2 = value;
    }
    
     
    @Column(name = "low_value1")
    public Double getLowValue1() {
        return this.lowValue1;
    }
    
    public void setLowValue1(Double value) {
        this.lowValue1 = value;
    }
    
     
    @Column(name = "low_value2")
    public Double getLowValue2() {
        return this.lowValue2;
    }
    
    public void setLowValue2(Double value) {
        this.lowValue2 = value;
    }
    
     
    @Column(name = "major_hazard_id", length = 32)
    public String getMajorHazardId() {
        return this.majorHazardId;
    }
    
    public void setMajorHazardId(String value) {
        this.majorHazardId = value;
    }
    
     
    @Column(name = "name", length = 50)
    public String getName() {
        return this.name;
    }
    
    public void setName(String value) {
        this.name = value;
    }
    
     
    @Column(name = "real_time_value")
    public Double getRealTimeValue() {
        return this.realTimeValue;
    }
    
    public void setRealTimeValue(Double value) {
        this.realTimeValue = value;
    }
    
     
    @Column(name = "stock")
    public Double getStock() {
        return this.stock;
    }
    
    public void setStock(Double value) {
        this.stock = value;
    }
    
     
    @Column(name = "substance_status", length = 10)
    public String getSubstanceStatus() {
        return this.substanceStatus;
    }
    
    public void setSubstanceStatus(String value) {
        this.substanceStatus = value;
    }
    
     
    @Column(name = "type", length = 20)
    public String getType() {
        return this.type;
    }
    
    public void setType(String value) {
        this.type = value;
    }
    
     
    @Column(name = "unit", length = 10)
    public String getUnit() {
        return this.unit;
    }
    
    public void setUnit(String value) {
        this.unit = value;
    }
    
     
    @Column(name = "update_by", length = 32)
    public String getUpdateBy() {
        return this.updateBy;
    }
    
    public void setUpdateBy(String value) {
        this.updateBy = value;
    }
    
     
    @Column(name = "update_time")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }
    
     
    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }
    
    public void setTenentId(Long value) {
        this.tenentId = value;
    }
    
     
    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }
    
    public void setOrgCode(String value) {
        this.orgCode = value;
    }
    

    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("cas",getCas())
            .append("createBy",getCreateBy())
            .append("createTime",getCreateTime())
            .append("criticalValue",getCriticalValue())
            .append("deleteFlag",getDeleteFlag())
            .append("hazardType",getHazardType())
            .append("highValue1",getHighValue1())
            .append("highValue2",getHighValue2())
            .append("lowValue1",getLowValue1())
            .append("lowValue2",getLowValue2())
            .append("majorHazardId",getMajorHazardId())
            .append("name",getName())
            .append("realTimeValue",getRealTimeValue())
            .append("stock",getStock())
            .append("substanceStatus",getSubstanceStatus())
            .append("type",getType())
            .append("unit",getUnit())
            .append("updateBy",getUpdateBy())
            .append("updateTime",getUpdateTime())
            .append("tenentId",getTenentId())
            .append("orgCode",getOrgCode())
            .toString();
    }
    
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj instanceof MhMajorHazardHch == false) return false;
        if(this == obj) return true;
        MhMajorHazardHch other = (MhMajorHazardHch)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

